package com.maomao.ssoserver.service;

import com.maomao.ssoserver.model.UserInfo;

public interface OAuthService {

    //添加 auth code
    public void addAuthCode(String authCode, String username);
    //添加 access token
    public void addAccessToken(String accessToken, String username);

    //验证auth code是否有效
    boolean checkAuthCode(String authCode);
    //验证access token是否有效
    boolean checkAccessToken(String accessToken);

    String getUsernameByAuthCode(String authCode);
    String getUsernameByAccessToken(String accessToken);


    //auth code / access token 过期时间
    long getAuthCodeExpireIn(String authCode);
    long getAccessTokenExpireIn(String accessToken);
    
    //提供客户端授权的资源接口
    UserInfo userInfo(String accessToken);

    //是不是全法的客户端
    public boolean checkClientIdAuth(String clientId);
    //客户端是否有权请求Token
    public boolean checkClientToken(String clientId,String clientSecret);


}
